package cn.qn.moudle.news;

import lombok.Data;
import org.hibernate.annotations.CreationTimestamp;
import org.hibernate.annotations.Table;
import org.hibernate.annotations.UpdateTimestamp;

import javax.persistence.*;
import java.io.Serializable;
import java.util.Date;

/**
 * @author Jeet
 * @description 新闻视频
 * @date 2019/5/29 17:06
 */
@Entity(name = "news_video")
@Data
@Table(appliesTo  = "news_video",comment="新闻视频")
public class Video implements Serializable {

    private static final long serialVersionUID = 4362430913562848374L;
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Column(name = "id" ,columnDefinition="int(11) COMMENT '主键'")
    private Integer id;

    @Column(name = "name" ,columnDefinition="varchar(20) COMMENT '视频名称'")
    private String name;

    @Column(name = "remark" ,columnDefinition="varchar(200) COMMENT '描述'")
    private String remark;

    @Column(name = "type" ,columnDefinition="int(11) COMMENT '类型,1=本地上传,2=优酷链接,待扩展'")
    private Integer type;

    @Column(name = "url" ,columnDefinition="text COMMENT '视频地址'")
    private String url;

    @Column(name = "cover" ,columnDefinition="int(11) COMMENT '封面图片ID'")
    private Integer cover;

    @Column(name = "banner" ,columnDefinition="int(11) COMMENT 'Banner图片ID'")
    private Integer banner;

    @Column(name = "status" ,columnDefinition="int(2) COMMENT '状态,1=显示;0-隐藏'")
    private Integer status;

    @Column(name = "create_time",columnDefinition="datetime COMMENT '创建时间'")
    @Temporal(TemporalType.TIMESTAMP)
    @CreationTimestamp
    private Date createTime;

    @Column(name = "create_by" ,columnDefinition="varchar(20) COMMENT '视频创建人userId'")
    private String createBy;

    @Column(name = "update_by" ,columnDefinition="varchar(20) COMMENT '视频修改人userId'")
    private String updateBy;

    @Column(name = "update_time",columnDefinition="datetime COMMENT '修改时间'")
    @Temporal(TemporalType.TIMESTAMP)
    @UpdateTimestamp
    private Date updateTime;
}
